package com.finace.money.data;

import com.finace.money.common.Constant;
import com.finace.money.common.util.ParamUtil;
import com.finace.money.data.bean.BaseBean;
import com.finace.money.data.bean.EmptyBean;
import com.finace.money.data.http.ApiService;
import com.finace.money.presenter.contract.OpenAccountContract;

import java.util.TreeMap;

import io.reactivex.Observable;

/**
 * Created by zhangpeng on 2018/1/26.
 */

public class OpenAccountModel implements OpenAccountContract.IOpenAccountModel {

    private ApiService mApiService;

    public OpenAccountModel(ApiService apiService) {
        this.mApiService = apiService;
    }

    @Override
    public Observable<BaseBean<EmptyBean>> checkPhone(String phone, String imgcode, String code) {

        TreeMap<String, String> map = new TreeMap<>();
        map.put("phone",phone);
        map.put("imgcode",imgcode);
        map.put("code",code);
        return mApiService.backEmpty(Constant.checkPhoneInterface, ParamUtil.getParma(map));
    }
}
